/*
 Navicat Premium Data Transfer

 Source Server         : 本机SQL Server
 Source Server Type    : SQL Server
 Source Server Version : 13001742
 Source Host           : localhost:1433
 Source Catalog        : Hotel
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13001742
 File Encoding         : 65001

 Date: 04/01/2022 20:04:43
*/


-- ----------------------------
-- Table structure for t_room
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_room]') AND type IN ('U'))
	DROP TABLE [dbo].[t_room]
GO

CREATE TABLE [dbo].[t_room] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [name] varchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [type] int  NOT NULL,
  [price] decimal(18,2)  NOT NULL,
  [location] varchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [status] varchar(6) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [remark] varchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[t_room] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of t_room
-- ----------------------------
SET IDENTITY_INSERT [dbo].[t_room] ON
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'1', N'101', N'1', N'38.00', N'101房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'2', N'102', N'2', N'48.00', N'102房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'3', N'103', N'3', N'48.00', N'103房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'4', N'104', N'4', N'48.00', N'104房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'5', N'105', N'5', N'58.00', N'105房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'6', N'106', N'6', N'68.00', N'106房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'7', N'107', N'6', N'68.00', N'107房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'8', N'108', N'6', N'68.00', N'108房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'9', N'109', N'6', N'68.00', N'109房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'10', N'110', N'6', N'68.00', N'110房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'11', N'201', N'7', N'68.00', N'201房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'12', N'202', N'7', N'68.00', N'202房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'13', N'203', N'7', N'68.00', N'203房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'14', N'204', N'7', N'68.00', N'204房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'15', N'205', N'7', N'68.00', N'205房间', N'空闲', N'特价')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'16', N'206', N'8', N'78.00', N'206房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'17', N'207', N'8', N'78.00', N'207房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'18', N'208', N'8', N'78.00', N'208房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'19', N'209', N'8', N'78.00', N'209房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'20', N'210', N'8', N'78.00', N'210房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'21', N'301', N'9', N'78.00', N'301房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'22', N'302', N'9', N'78.00', N'302房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'23', N'303', N'9', N'78.00', N'303房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'24', N'304', N'9', N'78.00', N'304房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'25', N'305', N'9', N'78.00', N'305房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'26', N'306', N'10', N'98.00', N'306房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'27', N'307', N'10', N'98.00', N'307房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'28', N'308', N'10', N'98.00', N'308房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'29', N'309', N'10', N'98.00', N'309房间', N'空闲', N'标准')
GO

INSERT INTO [dbo].[t_room] ([id], [name], [type], [price], [location], [status], [remark]) VALUES (N'30', N'310', N'10', N'98.00', N'310房间', N'空闲', N'标准')
GO

SET IDENTITY_INSERT [dbo].[t_room] OFF
GO


-- ----------------------------
-- Auto increment value for t_room
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[t_room]', RESEED, 32)
GO


-- ----------------------------
-- Uniques structure for table t_room
-- ----------------------------
ALTER TABLE [dbo].[t_room] ADD CONSTRAINT [UQ__t_room__unique] UNIQUE NONCLUSTERED ([name] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Checks structure for table t_room
-- ----------------------------
ALTER TABLE [dbo].[t_room] ADD CONSTRAINT [CK__t_room__id] CHECK ([status]='有客' OR [status]='空闲')
GO


-- ----------------------------
-- Primary Key structure for table t_room
-- ----------------------------
ALTER TABLE [dbo].[t_room] ADD CONSTRAINT [PK__t_room__id] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Foreign Keys structure for table t_room
-- ----------------------------
ALTER TABLE [dbo].[t_room] ADD CONSTRAINT [FK__t_room__type] FOREIGN KEY ([type]) REFERENCES [dbo].[t_type] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

